package com.lzy.wzy.listener;

import org.flowable.engine.TaskService;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component(value = "excListener")
public class submitTaskHandler implements TaskListener {

    @Autowired
    private TaskService taskService;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void notify(DelegateTask delegateTask) {
        taskService.complete(delegateTask.getId());
    }
}
